
use "SovietCollaboration_MainDataset.dta"

***Result on increase in team size, OLS and Poisson***

preserve
drop if sovietauthor==1
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
xtreg  logauthourcount  newbdaftersoviet _I*, robust cluster(adjustedmsc)
xtpoisson logauthourcount  newbdaftersoviet _I*, fe i(adjustedmsc)

gen topsovietdummy= 0
replace topsovietdummy=1 if newbdrankingposition<11
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
xtpoisson logauthourcount  topaftersoviet _I*, fe i(adjustedmsc)

drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<6
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
xtpoisson logauthourcount  topaftersoviet _I*, fe i(adjustedmsc)

drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
xtpoisson logauthourcount  topaftersoviet _I*, fe i(adjustedmsc)

drop if newbdrankingposition>3 & newbdrankingposition<31
drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
xtpoisson logauthourcount  topaftersoviet _I*, fe i(adjustedmsc)

***New Mahdi-Try Zero-Inflated Models
summarize coauthor
gen coauthor =0
replace coauthor= authorcount-1
xtset adjustedmsc
*Ordinary regressions with authorcount
xtreg  authorcount  topaftersoviet _I*, robust cluster(adjustedmsc)
xtpoisson authorcount  topaftersoviet _I*, fe i(adjustedmsc)
xtpoisson coauthor  topaftersoviet _I*, fe i(adjustedmsc)
poisson coauthor  topaftersoviet _I*
zip coauthor topaftersoviet _I*, inflate(topaftersoviet) vuong
***


***New Mahdi- Try 1980 as the cut-off point
set more off
preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen after1980 =0
replace after1980=1 if year>1980
gen topsovietafter1980=topsovietdummy*after1980
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
xtreg  logauthourcount  topsovietafter1980  _I*, robust cluster(adjustedmsc)
*Drop after 1990 so we have a balanced time span
drop if year>1990
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
xtreg  logauthourcount  topsovietafter1980 _I*, robust cluster(adjustedmsc)
*****
**New Mahdi- try 2000 as cut-off
set more off
preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen after2000 =0
replace after2000=1 if year>2000
gen topsovietafter2000=topsovietdummy*after2000
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
xtreg  logauthourcount  topsovietafter2000  _I*, robust cluster(adjustedmsc)
**Check to see what happens if we drop after
drop if year<1990
****

**New-Mahdi: Try Bottom 3 subfields
restore
preserve
drop if sovietauthor==1
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
drop if newbdrankingposition<31
drop bottomsovietdummy
drop bottomaftersoviet
gen bottomsovietdummy=0
replace bottomsovietdummy=1 if newbdrankingposition>30
gen bottomaftersoviet=afterdummy*bottomsovietdummy
xtreg  logauthourcount  bottomaftersoviet _I*, robust cluster(adjustedmsc)
xtpoisson logauthourcount  bottomaftersoviet _I*, fe i(adjustedmsc)
**

restore


***Result on increase in team size, graph***

preserve
drop if sovietauthor==1
xtset adjustedmsc
drop if newbdrankingposition>3 & newbdrankingposition<31
drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xi: gen i.year i.adjustedmsc i.year*topsovietdummy
xtreg  logauthourcount _I*, robust cluster(adjustedmsc)
restore


***Result on increase in team size, robustness to alternative ranking***

preserve

drop if sovietauthor==1
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
xtreg  logauthourcount  ouraftersoviet _I*, robust cluster(adjustedmsc)

gen topsovietdummy= 0
replace topsovietdummy=1 if ourrankingposition<11
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)

drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if ourrankingposition<6
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)

drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if ourrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)

drop if ourrankingposition>3 & ourrankingposition<31
drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if ourrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)

restore


***Result on increase in team size, robustness to including Soviet papers***

preserve

xi: gen i.year i.adjustedmsc
xtset adjustedmsc
xtreg  logauthourcount  newbdaftersoviet _I*, robust cluster(adjustedmsc)

gen topsovietdummy= 0
replace topsovietdummy=1 if newbdrankingposition<11
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)

drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<6
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)

drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)

drop if newbdrankingposition>3 & newbdrankingposition<31
drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)

restore


***Result on increase in team size in Japan***

preserve
keep if  japanesepub==1
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
keep if  japanesepub==1
keep if  japaneserankedjournal==1
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
keep if  japanesepub==1
keep if  japaneserankedjournal==.
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

**New-Mahdi: Continuous results for Japan
preserve
keep if  japanesepub==1
drop if sovietauthor==1
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
xtreg  logauthourcount  newbdaftersoviet _I*, robust cluster(adjustedmsc)
restore
**
**New-Mahdi: 3 Bottom subfields
preserve
keep if  japanesepub==1
drop if sovietauthor==1
drop if newbdrankingposition<31
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen bottomsovietdummy=0
replace bottomsovietdummy=1 if newbdrankingposition>30
gen bottomaftersoviet=afterdummy*bottomsovietdummy
xtreg  logauthourcount  bottomaftersoviet _I*, robust cluster(adjustedmsc)
restore
**New-Mahdi: top 3 subfields
preserve
keep if  japanesepub==1
drop if sovietauthor==1
drop if newbdrankingposition>3
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<3
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

**
***Result on increase in team size in Japan, graph***

preserve
drop if sovietauthor==1
keep if  japanesepub==1
xtset adjustedmsc
drop if newbdrankingposition>3 & newbdrankingposition<31
drop topsovietdummy
drop topaftersoviet
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xi: gen i.year i.adjustedmsc i.year*topsovietdummy
xtreg  logauthourcount _I*, robust cluster(adjustedmsc)
restore



***Result on increase in team size in other countries***

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="China"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Japan"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Korea"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="India"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Canada"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Italy"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Belgium"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Spain"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Netherlands"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Switzerland"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="USA"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="UK"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Singapore"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="Germany"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore

preserve
drop if sovietauthor==1
drop if newbdrankingposition>3 & newbdrankingposition<31
keep if affiliationcountry_adjusted=="France"
xi: gen i.year i.adjustedmsc
xtset adjustedmsc
gen topsovietdummy=0
replace topsovietdummy=1 if newbdrankingposition<4
gen topaftersoviet=afterdummy*topsovietdummy
xtreg  logauthourcount  topaftersoviet _I*, robust cluster(adjustedmsc)
restore




***Results on citations to prior Soviet art***

use "SovietCollaboration_CitationToSovietArtDataset.dta"

xi: gen i.year i.adjustedmsc
xtset adjustedmsc
xtreg  sovietpubreferences aftersoviet _I*, robust cluster(adjustedmsc)
xtreg  percentagesovietjournalref aftersoviet _I*, robust cluster(adjustedmsc)

gen aftersoviet_logauthorcount= logauthorcount* aftersoviet
gen sovietdummy_logauthorcount= logauthorcount* sovietdummy
gen afterdummy_logauthorcount= logauthorcount* afterdummy
xtreg  sovietpubreferences logauthorcount sovietdummy_logauthorcount afterdummy_logauthorcount aftersoviet_logauthorcount aftersoviet _I*, robust cluster(adjustedmsc)
xtreg  percentagesovietjournalref logauthorcount sovietdummy_logauthorcount afterdummy_logauthorcount aftersoviet_logauthorcount aftersoviet _I*, robust cluster(adjustedmsc)



***Results on specialization***

use "SovietCollaboration_SpecializationDataset.dta"

xtset adjustedauthorid
       
xi: gen i.year
xtreg  specializationcodecountlast5year sovietdummy aftersoviet _I* , robust cluster(adjustedauthorid)
xtreg  speccountperlast5years_bypub sovietdummy aftersoviet _I* , robust cluster(adjustedauthorid)
xtreg  specializationcodecountlast5year aftersoviet _I* , fe i( adjustedauthorid) robust cluster(adjustedauthorid)
xtreg  speccountperlast5years_bypub aftersoviet _I* , fe i( adjustedauthorid) robust cluster(adjustedauthorid)

xtreg  specializationcodecountlast5year sovietdummy aftersoviet pubage pubagesq _I* , robust cluster(adjustedauthorid)
xtreg  speccountperlast5years_bypub sovietdummy aftersoviet pubage pubagesq _I* , robust cluster(adjustedauthorid)
xtreg  specializationcodecountlast5year aftersoviet pubage pubagesq _I* , fe i( adjustedauthorid) robust cluster(adjustedauthorid)
xtreg  speccountperlast5years_bypub aftersoviet pubage pubagesq _I* , fe i( adjustedauthorid) robust cluster(adjustedauthorid)

xi: gen i.year i.year*sovietdummy
xtreg  speccountperlast5years_bypub _I* , robust cluster(adjustedauthorid)
